package com.qd.dict.sys;

import com.cdqidi.dict.annotation.FieldBind;
import com.cdqidi.dict.config.IFieldProcess;
import com.qd.common.dict.DictConstant;
import com.qd.common.panda.constant.PandaConstant;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 回执表发送结果
 *
 * @author sjk
 */
@Component
@RequiredArgsConstructor
public class SysMsgEventProcessImpl implements IFieldProcess {
    @Override
    public String processName() {
        return DictConstant.SYS_MSG_EVENT;
    }

    @Override
    public Object convertValue(FieldBind fieldBind, Object fieldValue) {
        if (null == fieldValue) {
            return "";
        }
        String code = fieldValue.toString();
        if (code.equals(PandaConstant.MSG_EVENT_MSG_CLASSIFY_1)) {
            return "小程序消息";
        }
        if (code.equals(PandaConstant.MSG_EVENT_MSG_CLASSIFY_2)) {
            return "短信";
        }
        return "";
    }
}